﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="classinfo.aspx.cs" Inherits="UI.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <a href="classinfoadd.aspx">添加</a>
            <%-- AutoGenerateColumns="False" 清除默认列   AllowSorting="True" 排序--%>
            <asp:GridView ID="GridView1" runat="server" DataKeyNames="Id" AutoGenerateColumns="False" AllowSorting="True" OnRowDeleting="GridView1_RowDeleting">
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="编号" />
                    <asp:BoundField DataField="Name" HeaderText="班级" />
                    <asp:BoundField DataField="Comment" HeaderText="备注" />
                    <%--DataNavigateUrlFields="Id" 将Id设为参数  DataNavigateUrlFormatString="classinfodeail.aspx?id={0}"   根据ID跳转页面--%>
                    <asp:HyperLinkField Text="详情" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="classinfodeail.aspx?id={0}"/>
                    <asp:HyperLinkField Text="编辑" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="classinfoupdate.aspx?id={0}"/>
                    <asp:CommandField ShowDeleteButton="True" />

                </Columns>
            </asp:GridView>
        </div>
    </form>
</body>
</html>
